package com.atguigu.spzx.product.controller;

import com.atguigu.spzx.model.entity.product.Category;
import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import com.atguigu.spzx.model.vo.h5.IndexVo;
import com.atguigu.spzx.product.service.IndexService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: IndexController
 * @Package: com.atguigu.spzx.product.controller
 * @Description h5
 * @Author 孤妤
 * @Date: 2023/12/18 10:38
 */
@Tag(name = "H5首页")
@RestController
@RequestMapping("/api/product/index")
public class IndexController {
    @Autowired
    private IndexService indexService;
    @GetMapping
    @Operation(summary = "获取首页数据")
    public Result<IndexVo> findIndexVo(){
        IndexVo indexVo = indexService.findIndexVo();
        return Result.build(indexVo, ResultCodeEnum.SUCCESS);
    }
}
